
.lightbox-wrapper {
    background: rgba(0,0,0,.8);
    position: fixed;
    opacity: 0;
    visibility: hidden;
    transition: opacity .5s ease 0s, visibility .5s ease 0s;
    top: 0;
    left: 0;
    z-index: 9999999;
    width: 100%;
    height: 100%;
}

.lightbox-wrapper.active {
    opacity: 1;
    visibility: visible;
}

.lightbox .content {
    background: rgba(0,0,0,.7);
    top: 0;
    color: #fff;
    font-size: 20px;
    position: absolute;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    text-align: center;
    padding: 10px 30px;
    z-index: 1;
    transition: opacity .5s ease 0s, visibility .5s ease 0s;
    pointer-events: none;
}

.lightbox.active .content {
    opacity: 1;
    visibility: visible;
}

.lightbox-close {
    color: #fff;
    font-size: 40px;
    z-index: 2;
    opacity: 1;
    position: absolute;
    right: 30px;
    top: 10px;
    transform: scale(1);
    transition: transform 1s ease 0s;
}

.lightbox-close:hover {
    cursor: pointer;
    transform: scale(1.2);
}

.next,
.prev {
    color: #fff;
    position: absolute;
    top: 50%;
    font-size: 40px;
    transform: translateY(-50%) scale(1);
    transition: transform 1s ease 0s;
    z-index: 1;
}

.next:hover,
.prev:hover {
    cursor: pointer;
    transform: translateY(-50%) scale(1.2); 
}

.next {
    right: 30px;
}

.prev {
    left: 30px;
}

.lightbox img,
.lightbox > div {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(.9);
    max-width: 96%;
    max-height: 96%;
    box-shadow: 4px 2px 8px rgba(0, 0, 0, 1);
    transition: transform 1.5s ease 0s, opacity .5s ease 0s, visibility .5s ease 0s;
}

.lightbox > div {
    box-shadow: none;
}

.lightbox.active img,
.lightbox.active > div {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.gallery-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    grid-gap: 10px;
}

.gallery-wrapper .gallery-item {
    overflow: hidden;
    position: relative;
}

.gallery-wrapper .gallery-item:hover {
    cursor: pointer;
}

.gallery-wrapper .gallery-item .play {
    position: absolute;
    font-size: 50px;
    color: rgba(255,255,255,.6);
    text-align: center;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    transition: color 1s ease 0s;
}

.gallery-wrapper .gallery-item:hover .play {
    color: #fff;
}

.gallery-wrapper .gallery-item .title {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0,0,0,.5);
    text-align: center;
    transition: opacity 1s ease 0s, visibility 1s ease 0s;
    opacity: 0;
    visibility: hidden;
}

.gallery-wrapper .gallery-item:hover .title {
    opacity: 1;
    visibility: visible;
}

.gallery-wrapper .gallery-item .title p {
    color: #fff;
    margin: 5px 10px;
}

.gallery-wrapper .gallery-item .position {
    background: #000;
    color: #fff;
    position: absolute;
    top: 0;
    padding: 5px 10px;
    z-index: 1;
}

.gallery-wrapper .gallery-item img {
    transition: transform 2s ease 0s;
    height: 100%;
    width: 100%;
    position: relative;
    object-fit: cover;
}

.gallery-wrapper .gallery-item:hover img {
    transform: scale(1.2);
}

@media screen and (max-width: 767px) {
    .next,
    .prev,
    .lightbox-close {
        font-size: 30px;
    }
}

@media screen and (max-width: 480px) {

    .gallery-wrapper .gallery-item {
        width: 100%;
    }
}